package com.ebay.paisapay;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.*;

import com.ebay.util.DBconn;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class showbankdetails extends ActionSupport {
private String payee_name, bank_acc_num,bank_name, branch, city;
Map session;

ArrayList<String> det;
ResultSet rs;
Connection conn=null;
DBconn db=new DBconn();
Statement stmt=null;
int r;
String url;




public String execute(){
	String ebayid;
    session=ActionContext.getContext().getSession();
	ebayid= (String)session.get("ebay_id");
//	if(!(Boolean)session.get("loggedin"))
//	{
//		session.put("fromcart",true);
//		return "fail";
//	}
	conn=db.getConnection();
	
	url="select * from paisapayreg where ebay_id='"+ebayid+"'";
	try {
		stmt=conn.createStatement();
		rs=stmt.executeQuery(url);
		if(rs.next()){
			payee_name=rs.getString("payee_name");
			bank_acc_num=rs.getString("bank_acc_num");
			System.out.println("bank account no" + bank_acc_num);
			bank_name =rs.getString("bank_name");
			branch =rs.getString("branch_name");
			city=rs.getString("city");
		}
		else
			return "noaccount";
	} catch (Exception e) {
		System.out.println("error in paisa pay"+e.getMessage());
		e.printStackTrace();
		// TODO Auto-generated catch block
	
	}
	
	
	return "success";
}





public String getPayee_name() {
	return payee_name;
}

public void setPayee_name(String payee_name) {
	this.payee_name = payee_name;
}

public String getBank_name() {
	return bank_name;
}

public void setBank_name(String bank_name) {
	this.bank_name = bank_name;
}

public String getBranch() {
	return branch;
}

public void setBranch(String branch) {
	this.branch = branch;
}

public String getCity() {
	return city;
}

public void setCity(String city) {
	this.city = city;
}





public String getBank_acc_num() {
	return bank_acc_num;
}





public void setBank_acc_num(String bank_acc_num) {
	this.bank_acc_num = bank_acc_num;
}
}
